﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using BudgetManager.Domain;
using Microsoft.Phone.Shell;

namespace BudgetManager
{
    public partial class ViewAccount : PhoneApplicationPage
    {
        public ViewAccount()
        {
            InitializeComponent();
            listBoxUsers.ItemsSource = AccountManager.ReadAllAccounts();
            listBoxUsers.SelectedItem = listBoxUsers.Items[0]; //Existe pelo menos uma conta
        }

        private void onDoubleTap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            
        }

        private void onClick(object sender, EventArgs e)
        {
            PhoneApplicationService.Current.State["accountselected"] = listBoxUsers.SelectedItem;
            NavigationService.Navigate(new Uri(string.Format("/EditAccount.xaml?"), UriKind.Relative));
        }
    }
}